<div id="user_rapoarte_facturi_anulate"></div>

<script type="text/javascript">			
	Ext.onReady(function(){	
	
	var ds_facturi_anulate;
	var cm_facturi_anulate;
	var grid_user_rapoarte_facturi_anulate;	
/**
 * grid
 * ************************************************************************
 */	
		
	    ds_facturi_anulate = new Ext.data.Store({
			id			:'table_ds',
	        remoteSort	:true,
			baseParams	:{saferequest:true,table:'facturi_anulate',cyDep:true},			
	        proxy: new Ext.data.HttpProxy({
	            url: 'common/getTable/' + Math.random()		
	        }),
	        reader: new Ext.data.JsonReader({
	            root: 'DS_FACTURI_ANULATE',
	            totalProperty: 'totalCount',
	            id: 'ID',
	            fields: [
	                'nr_factura', 'data_emiterii', 'motivul', 'data'
	            ]
	        })
	    });	

		ds_facturi_anulate.setDefaultSort('nr_factura', 'desc');
	    ds_facturi_anulate.load({params:{start:0, limit:22}});
					
	    cm_facturi_anulate = new Ext.grid.ColumnModel([
				{header: "Numar",				dataIndex: 'nr_factura'},
				{header: "Data emiterii",		dataIndex: 'data_emiterii'},
				{header: "Motivul",				dataIndex: 'motivul'},
				{header: "Data anularii",		dataIndex: 'data'}				
		]);
		
    	cm_facturi_anulate.defaultSortable = true;	
		
	    grid_user_rapoarte_facturi_anulate = new Ext.grid.GridPanel({
			id:'gridfacturianulate' + Math.random(),
	        renderTo:'center',
			height:569,
			anchor:'100%',	
			frame:false,					
	        title:'<?=$title?>',
	        store: ds_facturi_anulate,
	        cm: cm_facturi_anulate,
	        loadMask: true,
	        viewConfig: {
	            forceFit:true							
	        },
	        tbar:[],		
	        bbar: new Ext.PagingToolbar({
				beforePageText:'Pagina&nbsp;',
				afterPageText:'din {0}',
				firstText:'Prima pagina',
				lastText:'Ultima pagina',
				nextText:'Pagina urmatoare',
				prevText:'Pagina precedenta',   
	            pageSize: 22,
	            store: ds_facturi_anulate,
	            displayInfo: true,
	            displayMsg: 'Facturi anulate {0} - {1} din {2}',
	            emptyMsg: "No records",
				plugins: new Ext.ux.Andrie.pPageSize({
					  beforeText:'',		
				      afterText: '&nbsp;inreg/pagina',
				      comboCfg: {width: 50}
				      })
			}),plugins: new Ext.ux.grid.Search({
						searchText:'Criterii',
						searchTipText:'Introduceti textul dorit...',
						iconCls:'b_search_cls',
						minChars:2,
						autoFocus:true,
						text:'Cauta dupa camp',
						mode:'remote',
						position:'top'
			})
		});		

	//end on document ready
	});
</script>
